<!--{eval $_TPL['titles'] = array('群组', '社区');}-->
<!--{template header}-->

<div class="searchbar">
	<form method="get" action="network.php">
		<table cellspacing="2" cellpadding="2" id="adv_search">
			<tr>
				<td>
					<input type="hidden" name="ac" value="mtag" />
					<input type="hidden" name="searchmode" value="1" />
					<select name="upid" id="selectTypeTop">
						<option value="0">选择大项</option>
					</select>
					<select name="fieldid" id="selectTypeSecond">
						<option value="0">请选择小项</option>
					</select>
				</td>
				<td style="padding-left:3px;">群组名*</td>
				<td>
					<input type="text" name="key" value="$_GET[key]" size="15" class="t_input" />
				</td>
				<td>
				
				<input type="submit" value="搜索" class="submit" />
				</td>
			</tr>
		</table>
	</form>
</div>


<h2 class="title"><img src="image/app/mtag.gif">群组</h2>
<div class="tabs_header">
	<ul class="tabs">
		<li><a href="space.php?do=mtag"><span>我的群组</span></a></li>
		<li class="active"><a href="network.php?ac=mtag&view=hot"><span>热门群组</span></a></li>
		<li><a href="space.php?uid=$space[uid]&do=thread"><span>群组最新话题</span></a></li>
		<li><a href="space.php?uid=$space[uid]&do=thread&view=me"><span>我发起的话题</span></a></li>
		<li class="null"><a href="cp.php?ac=mtag">创建我的群组</a></li>
		<li class="null"><a href="cp.php?ac=thread">发起新话题</a></li>
	</ul>
</div>


<div class="h_status">
群组分类：
<select id="profieldtop" onchange="selectTopField(this.value);">
	<option value="0">全部</option>
	<!--{loop $_SGLOBAL['profield'] $value}-->
	<option value="$value[upid]">$value[title]</option>
	<!--{/loop}-->
</select>

<script type="text/javascript">
var selectTopField = function(id){
	var url = window.location.href;
	url = url.replace(/[?|&]upid(.*)&/ig,'&');
	url = url.replace(/[?|&]upid(.*)/ig,'');
	
	url = url.replace(/[?|&]fieldid(.*)&/ig,'&');
	url = url.replace(/[?|&]fieldid(.*)/ig,'');
		
	if(id == 0 || id=='0'){

		window.location.href = url ;
		return ;
	}

	if(url.indexOf('?') != -1)
		url += '&';
	else
		url += '?';
	
	url += 'upid='+id ;
	window.location.href = url ;
}

var setTopField = function(id){
	var objSelect = document.getElementById('profieldtop') ;
	for (var i = 0; i < objSelect.options.length; i++) {    
		if (objSelect.options[i].value == id) {
			objSelect.options[i].selected=true;
			break ;
		}
	}		
}
//显示群组时候的
coreTypeJs = <!--{$json_core_type}--> ;


setTopField(<!--{$upid}-->);
showCoreSelect('selectTypeTop','selectTypeSecond') ;
setCoreSelect('<!--{$upid}-->','<!--{$gets['fieldid']}-->','selectTypeTop','selectTypeSecond');

</script>

<!--{if $upid!=0}-->
<!--{loop $_SGLOBAL['profield'][$upid]['children'] $value}-->
	<span class="pipe">|</span>
	<a href="network.php?ac=mtag&fieldid=$value[fieldid]&upid=$value['upid']">
	<!--{if $gets['fieldid'] == $value['fieldid']}-->
	<b>$value[title]</b>
	<!--{else}-->
	$value[title]
	<!--{/if}-->
	</a>
<!--{/loop}-->
<!--{/if}-->
</div>

<div id="content">
	<div class="box">
		<ul class="thread_list">
		<!--{loop $list $value}-->
			<li>
				<div class="threadimg60"><a href="space.php?do=mtag&tagid=$value[tagid]"><img src="$value[pic]" style="width:60px;"></a></div>
				<a href="space.php?do=mtag&tagid=$value[tagid]" class="fs-14">$value[tagname]</a>
				<div class="pt10">
				已有 <span class="num">$value[membernum]</span> 人加入
				</div>
			</li>
		<!--{/loop}-->
		</ul>
		
		<div class="page">
			<!--{if $multi=='networkpage'}-->仅显示最热的 $count 个群组<!--{else}-->$multi<!--{/if}-->
		</div>
	</div>
</div>


<div id="sidebar">
	
	<!--{if $threadlist}-->
	<div class="sidebox">
		<h2 class="title">这些群组的最新话题</h2>
		<ul class="line_list">
		<!--{loop $threadlist $value}-->
			<li>
				<p><a href="space.php?uid=$value[uid]&do=thread&id=$value[tid]">$value[subject]</a></p>
				<p class="gray"><a href="space.php?uid=$value[uid]">{$_SN[$value[uid]]}</a> 发表于 <a href="space.php?do=mtag&tagid=$value[tagid]">$value[tagname]</a></p>
			</li>
		<!--{/loop}-->
		</ul>
	</div>
	<!--{/if}-->
	
</div>
<!--/sidebar-->
<!--{template footer}-->
